package com.homegoods.videomodule.item;

import android.text.SpannableStringBuilder;

import com.homegoods.videomodule.R;
import com.homegoods.videomodule.model.CommentModel;
import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseItem;

/**
 * @author QiQi
 * @ClassName: CommentItem
 * @date 2018/10/15
 * @description
 */
public class CommentItem extends BaseItem<CommentModel> {
    public CommentItem(CommentModel commentModel, MultiTypeAdapter adapter) {
        super(commentModel);
        setOnClickListener(v -> {
            if (adapter.getOnItemClickListener() != null) {
                adapter.getOnItemClickListener().onItemClicked(v, this);

            }
        });
    }

    public String getHeadUrl() {
        return getData().getSenderSid().getHeadUrl();
    }

    public String getTime() {
        return getData().getTime();
    }

    public SpannableStringBuilder getComment() {
        return getData().getComment();
    }

    public String getName() {
        return getData().getSenderSid().getName();
    }

    public String getReplyCount() {
        return getData().getReplyCount();
    }

    public String getGoodCount() {
        return getData().getGoodCount();
    }

    public int getHasGood() {
        return getData().getHasGood();
    }

    @Override
    public int getLayout() {
        return R.layout.video_item_comment;
    }
}
